<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>2014 年到 2050 年哪年一月一日是星期日</title>
</head>

<body>
  <script>
    var myDate = new Date('2014');
    var y = myDate.getFullYear()
    var m = myDate.getMonth()
    var week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
    for (var i = 2014; i <= 2050; i++) {
      var d = new Date(y, m, 1)
      if (d.getDay() == 0) {
        console.log(y, week[d.getDay()])
      }
      y++
    }
  </script>
</body>

</html>